<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%@ page import="java.util.Calendar, com.scalar.chiptrack.utils.ConfigManager"%>

<chiptrack:checkLogon sourcePage="/settingForecast.do" />


<HTML><HEAD>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<script>

	function getQuarter(month,year){

	 Q1From = new Date(year, month-1, "01");
	 var q1_from = new Date(Q1From);
	 Q1To = new Date(Q1From.setMonth(Q1From.getMonth()+3));
	 var q1_to = new Date(Q1To);
	 Q2From = new Date(Q1To.setMonth(Q1To.getMonth()));
	 var q2_from = new Date(Q2From);
	 Q2To = new Date(Q2From.setMonth(Q2From.getMonth()+3));
	 var q2_to = new Date(Q2To);
	 Q3From = new Date(Q2To.setMonth(Q2To.getMonth()));
	 var q3_from = new Date(Q3From);
	 Q3To = new Date(Q3From.setMonth(Q3From.getMonth()+3));
	 var q3_to = new Date(Q3To);
	 Q4From = new Date(Q3To.setMonth(Q3To.getMonth()));
	 var q4_from = new Date(Q4From);
	 Q4To = new Date(Q4From.setMonth(Q4From.getMonth()+3));
	 var q4_to = new Date(Q4To);


     var thisDate = new Date();
	 if (thisDate >= q1_from && thisDate < q1_to)
		 return "quarter1";
	 else if (thisDate >= q2_from && thisDate < q2_to)
 		 return "quarter2";
	 else if (thisDate >= q3_from && thisDate < q3_to)
 		 return "quarter3";
	 else if (thisDate >= q4_from && thisDate < q4_to)
 		 return "quarter4";
	 else
		 return "past";


}

function proActual(){

    document.projectedActualForm.prompt2.value = document.projectedActualForm.quarter.value;
    document.projectedActualForm.prompt3.value = document.projectedActualForm.year.value;

    var quarter = document.projectedActualForm.quarter.value;


        var d = new Date();
		var day = d.getDate();
		var month = d.getMonth()+1;
		var year = d.getFullYear();
		var hour = d.getHours();
		var min = d.getMinutes();
		var sec = d.getSeconds();

		var defaultPrompt = day+"/"+month+"/"+year+":"+hour+":"+min+":"+sec;

    document.projectedActualForm.prompt6.value = defaultPrompt;
    document.projectedActualForm.prompt7.value = 0

    document.projectedActualForm.action = "<%=chipTracContext%>/jsp/report.jsp?nameReport=Marketing/Forecast/Forecast_Actual_Report.rpt";
    document.projectedActualForm.submit();

 }
</script>
<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<form name="projectedActualForm" method="post">
<input type="hidden" name="prompt2">
<input type="hidden" name="prompt3">
<input type="hidden" name="prompt6">
<input type="hidden" name="prompt7">
<%--End of Modication by lavanya , July 26 --%>
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/marketing/marketing_report_menu.jsp" %>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->

<center><span class="NArialW"> Forecast Vs. Actual Report </span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

  <table border="0" width="90%" align=right>
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer/gif" height=10></td></tr>
    <tr>

      <td width="15%"><font class="NArialL">Quarter</font></td>
      <td width="20%"><font class="NArialL">
	  <select name="quarter" class="txfield">

           <% String currentQtr = (String) request.getAttribute("currentQtr"); %>
           <logic:iterate id="quarterList" name="quarterList">
        	    <logic:notEqual name="quarterList" value="null">
                    <logic:equal name="quarterList" property="value" value="<%=currentQtr%>">
                        <option value = "<bean:write name="quarterList" property="value"/>" SELECTED>
                            <bean:write name="quarterList" property="label"/>
                        </option>
                    </logic:equal>
                    <logic:notEqual name="quarterList" property="value" value="<%=currentQtr%>">
                        <option value = "<bean:write name="quarterList" property="value"/>" >
                            <bean:write name="quarterList" property="label"/>
                        </option>
                    </logic:notEqual>
                </logic:notEqual>
            </logic:iterate>

        </select>
      </td>
      <td width="10%">&nbsp;</td>
      <td width="13%"><font class="NArialL">FY Start Year </font></td>
      <td width="20%"><font class="NArialL">
             <html:select name="projectedActualForm" property="year" styleClass="txfield" value='<%=Integer.toString(Calendar.getInstance().get (Calendar.YEAR))%>'>
             <html:options collection="years" property="value" labelProperty="label" />
        </html:select>
       <td width="10%">&nbsp;</td>
    </tr>

 	<tr>
     <td width="25%"><font class="NArialL">Product <br> (<bean:message key="label.mfgPartNumber" />)</font></td>
	 <td width="20%"><font class="NArialL">
	     	<select size="1" name="prompt1" class="txfield">
	        <option value="0">Select Any product</option>
                <logic:iterate id="productList" name="productList">
                   <logic:notEqual name="productList" value="null">
                       <option value="<bean:write name="productList" property="value"/>">
                           <bean:write name="productList" property="label"/>
                       </option>
                   </logic:notEqual>
                </logic:iterate>
            </select>
	 </td>
     <td width="10%">&nbsp;</td>
       <td width="15%"><font class="NArialL">Customer</font></td>
	  <td width="20%"><font class="NArialL">
	     	<select size="1" name="prompt0" class="txfield">
	        <option value="0">Select Any Customer</option>
                <logic:iterate id="customerList" name="customerList">
                   <logic:notEqual name="customerList" value="null">
                       <option value="<bean:write name="customerList" property="value"/>">
                           <bean:write name="customerList" property="label"/>
                       </option>
                   </logic:notEqual>
                </logic:iterate>
            </select>
     </td>
  </tr>

      <tr>
      <td width="25%"><font class="NArialL">Sales Person</font></td>
      <td width="20%"><font class="NArialL">
          <select name="prompt4" class="txfield" >
                <option value="0" >Select Any Sales Person</option>
                <logic:iterate id="salesPersonList" name="salesPersonList">
        	    <logic:notEqual name="salesPersonList" value="null">
                    <option value = "<bean:write name="salesPersonList" property="value"/>">
                        <bean:write name="salesPersonList" property="label"/>
                    </option>
                </logic:notEqual>
            </logic:iterate>
          </select>
      </td>
      <td width="10%">&nbsp;</td>
     <td width="25%"><font class="NArialL"><bean:message key="label.sales.endCustomer"/></font></td>
      <td width="20%"><font class="NArialL">
          <select name="prompt5" class="txfield" >
            <option value="0" >Select Any <bean:message key="label.sales.endCustomer"/></option>
            <logic:iterate id="endUserList" name="endUserList">
        	    <logic:notEqual name="endUserList" value="null">
                    <option value = "<bean:write name="endUserList" property="value"/>">
                        <bean:write name="endUserList" property="label"/>
                    </option>
                </logic:notEqual>
            </logic:iterate>

          </select>
      </td>
      </tr>


    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>


	<tr>
      <td colspan=5 align=center>
	  <a href="javascript:proActual();" onMouseOver="window.status='Click to Generate Revenue Report ';return true" onMouseOut="window.status='';return true" title= "Click here to Generate Projected Vs. Actual Revenue Report "><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17"></a>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <a href="javascript:document.projectedActualForm.reset();"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border='0' onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true"title="Click here to Reset"></a>
      </td>
    </tr>
  </table>


<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</form>
</BODY>
</HTML>
